import React, { PureComponent } from 'react';
import { connect } from 'dva';
import Link from 'umi/link';

import Exception from './index';

class NotFound extends PureComponent {
    render() {
        const { loading, global } = this.props;
        console.info(this.props);
        return (
            loading ? null : <Exception type={404} style={{ height: '100%' }} linkElement={Link} to={global.originUrl ? global.originUrl : '/'} />
        );
    }
}

export default connect(({ global, loading }) => ({ global, loading: loading.effects['global/fetchMenu'] }))(NotFound);
